package com.study.biz;

import java.util.List;

import com.study.bean.Commodity;
import com.study.dao.Commoditydao;

public class Commoditybiz {
	private Commoditydao dao=new Commoditydao(Commodity.class);
	//鏌ヨ涓诲晢鍝�
	public List<Commodity> selectComm(int pageNo,int pageSize){
		return dao.selectComm(pageNo,pageSize);
	}
	//鑾峰彇鏁版嵁鎬绘潯鏁�
	public int getCount(){
		return dao.getCount();
	}
	//鑾峰彇涓婃灦鎬绘暟閲�
	public int getupCount(){
		return dao.getupCount();
	}
	//鑾峰彇涓嬫灦鎬绘暟閲�
	public int getdownCount(){
		return dao.getdownCount();
	}
	//鑾峰彇妯＄硦鏌ヨ鎬绘潯鏁�
	public int likenameCount(String cname){
		System.out.println(dao.likenameCount(cname));
		return dao.likenameCount(cname);
	}
	//鏇存嵁涓婁笅鏋跺垎椤垫煡璇�
	public List<Commodity> isupComm(int up,int pageNo,int pageSize){
		return dao.isupComm(up, pageNo, pageSize);
	}
	//鏍规嵁妯＄硦鍒嗛〉鏌ヨ
	public List<Commodity> likeName(String name,int pageNo,int pageSize){
		return dao.likeName(name, pageNo, pageSize);
	}
	//鎻掑叆涓诲晢鍝�
	public int insertcomm(Commodity com){
		return dao.insertcomm(com);
	}
	//更据id查询主商品
	public Commodity selectByid(int cid){
		return dao.selectByid(cid);
	}
	//更新操作
	public int updateComm(Commodity comm){
		return dao.updateComm(comm);
	}
	//查询所有主商品
	public List<Commodity> selectAll(){
		return dao.selectAll();
	}
}
